home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
utility
/
utilfile
/
rw2ent15.lha
/
Raw2Ent.rexx.old
< prev
Wrap
Text File
|
1996-11-01
|
5KB
|
171 lines
/* Raw2Ent by Tamio Patrick Honma for HHU CWIS-Project
$VER:1.3.4 (01.11.96)
*/
options results
options cache
parse arg source destination tag
filename=source
s1=REVERSE(source)
n=VERIFY(s1,':/','m')
IF n>0 THEN DO
filename=REVERSE(LEFT(s1,n-1))
END
say 'Filename = '||filename
say 'Source = '||source
IF RIGHT(destination,1)='/' | RIGHT(destination,1)=':' THEN destination=destination||filename||'.ent'
ELSE destination=destination||'.ent'
say 'Destination = '||destination
tag=UPPER(tag)
IF tag~='HTML' | tag~='TAG' THEN DO
IF open('env','ENV:cwis/'||filename,'r') THEN DO
tag=UPPER(readln('env'))
close('env')
say(tag)
END
END
IF tag='HTML' THEN address command 'copy '||source||' '||destination
ELSE DO
IF tag='TAG' THEN say('----> TAG-Mode avtivated! The chars: < > & " will not be converted <----')
ELSE tag=''
IF open('raw',source,'r') THEN DO
say('opened:'||source)
IF open('ent',destination,'w') THEN DO
say('opened:'||destination)
len=seek('raw',0,'E')
say('size='||len)
dumm=seek('raw',0,'B')
DO i=1 TO len
c=readch('raw',1)
IF BITTST(c,7) | c='>' | c='<' | c='"' | c='&' THEN DO
say('found:'||c||' at '||i)
SELECT
when c='ä' then c='ä'
when c='Ä' then c='Ä'
when c='ö' then c='ö'
when c='Ö' then c='Ö'
when c='ü' then c='ü'
when c='Ü' then c='Ü'
when c='ï' then c='ï'
when c='Ï' then c='Ï'
when c='ÿ' then c='ÿ'
when c='ë' then c='ë'
when c='Ë' then c='Ë'
when c='©' then c='©'
when c='®' then c='®'
when c='þ' then c='Þ'
when c='Þ' then c='þ'
when c='Ð' then c='Ð'
when c='ð' then c='ð'
when c=' ' then c=' '
when c='è' then c='è'
when c='È' then c='È'
when c='ò' then c='ò'
when c='Ò' then c='Ò'
when c='ù' then c='ù'
when c='Ù' then c='Ù'
when c='ì' then c='ì'
when c='Ì' then c='Ì'
when c='à' then c='à'
when c='À' then c='À'
when c='é' then c='é'
when c='É' then c='É'
when c='ó' then c='ó'
when c='Ó' then c='Ó'
when c='ú' then c='ú'
when c='Ú' then c='Ú'
when c='í' then c='í'
when c='Í' then c='Í'
when c='á' then c='á'
when c='Á' then c='Á'
when c='ý' then c='ý'
when c='Ý' then c='Ý'
when c='ê' then c='ê'
when c='Ê' then c='Ê'
when c='ô' then c='ô'
when c='Ô' then c='Ô'
when c='û' then c='û'
when c='Û' then c='Û'
when c='î' then c='î'
when c='Î' then c='Î'
when c='â' then c='â'
when c='Â' then c='Â'
when c='ç' then c='ç'
when c='Ç' then c='Ç'
when c='ñ' then c='ñ'
when c='Ñ' then c='Ñ'
when c='õ' then c='õ'
when c='Õ' then c='Õ'
when c='ã' then c='ã'
when c='Ã' then c='Ã'
when c='å' then c='å'
when c='Å' then c='Å'
when c='ß' then c='ß'
when c='æ' then c='æ'
when c='Æ' then c='Æ'
when c='ø' then c='ø'
when c='Ø' then c='Ø'
when c='¡' then c='¡'
when c='¢' then c='¢'
when c='£' then c='£'
when c='¤' then c='¤'
when c='¥' then c='¥'
when c='¦' then c='¦'
when c='¨' then c='¨'
when c='ª' then c='ª'
when c='«' then c='«'
when c='¬' then c='¬'
when c='' then c=''
when c='¯' then c='¯'
when c='°' then c='°'
when c='±' then c='±'
when c='²' then c='²'
when c='³' then c='³'
when c='´' then c='´'
when c='µ' then c='µ'
when c='¶' then c='¶'
when c='·' then c='·'
when c='¸' then c='¸'
when c='¹' then c='¹'
when c='º' then c='º'
when c='»' then c='»'
when c='¼' then c='¼'
when c='½' then c='½'
when c='¾' then c='¾'
when c='¿' then c='¿'
when c='×' then c='×'
when c='÷' then c='÷'
when c='>' then IF tag~='TAG' THEN c='>'
when c='<' then IF tag~='TAG' THEN c='<'
when c='"' then IF tag~='TAG' THEN c='"'
when c='&' then IF tag~='TAG' THEN c='&'
OTHERWISE
END
say(' -> '||c)
END
call writech('ent',c)
END
call writeln('ent','')
call writeln('ent','<!--- entity codes generated on a '||len||' bytes large file on '||DATE()||' by Raw2Ent (c) 1996 TPH --->')
call close('ent')
say('closed:'||destination)
address command 'setenv cwis/'||filename||' TAG'
address command 'copy env:cwis/ envarc: all'
say('ENV:'||filename)
END
call close('raw')
say('closed:'||source)
END
END